#!/usr/bin/perl

require './telnet-lib.pl';

my ($telnet_stat);

&header($text{'telnet_title'}, "", undef, 0, 1);

$telnet_stat = &get_telnet_status();

if($telnet_stat eq "started"){
	$telnet_stat = $text{'telnet_start'};
}elsif($telnet_stat eq "stopped"){
	$telnet_stat = $text{'telnet_stop'};
}elsif($telnet_stat eq "warning"){
	$telnet_stat = $text{'warning'};
}

print "<form name=tnform action=telnet_act.cgi method=post>\n";

print "<table class=mode1>\n";
print "<tr><td>$text{'telnet_status'}</td><td><b>$telnet_stat</b></td></tr>";
print "<tr><td>$text{'telnet_passwd'}</td><td><input name=passwd type=password class=text></td>\n";
print "</table>\n";
print "<table class=mode1>\n";
print "<tr><td><input name=submit_start type=submit class=button1 value='start' onclick='start_telnet()'></td>\n";
print "<td><input name=submit_stop type=submit class=button1 value='stop' onclick='stop_telnet()'></td>\n";
print "</tr>";
print "</table>";
print "<p><input name=oper type=hidden value=\'\'>";

print "</form>\n";

print <<EOF;
<script>
function start_telnet()
{

	document.forms[0].oper.value = "start";
}

function stop_telnet()
{
	document.forms[0].oper.value = "stop";
}

</script>
EOF

&footer("/", $text{'index'});
